package Exple.sysManger.Controller;

import Exple.sysManger.pojo.UserList;
import Exple.sysManger.service.UserImplementsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ReControllers {

    @Autowired
    UserImplementsService userImplementsService;
    @RequestMapping("/start")
    public String stratMain(){
        return "SpringMVC Controller and for JSP servlet Start Success!";
    }

    @RequestMapping("/db_select")
    public List<UserList> selectAll(){
        return userImplementsService.selectUser();
    }

    @RequestMapping("/add_user")
    public UserList add_user0(){
        UserList userList = new UserList("test", "123456", "role", "imager", "create_date");
        userImplementsService.insertUser(userList);
        return userList;
    }
}
